<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
		<div class="btn-group hidden-xs" id="toolbar" role="group">
			<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="module:payapplyRecord:add">
				<i class="fa fa-plus"></i> 新增
			</a>
			<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="module:payapplyRecord:remove">
				<i class="fa fa-trash-o"></i> 删除
			</a>
		</div>
			
		<div class="col-sm-12 select-info table-striped">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
    </div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('module:payapplyRecord:edit')}]];
        var removeFlag = [[${@permission.hasPermi('module:payapplyRecord:remove')}]];
        var datass = [[${@dict.getType('pay_status')}]];
        var datass1 = [[${@dict.getType('vip_type')}]];
        var prefix = ctx + "module/payapplyRecord"

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                modalName: "交易记录",
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : '' 
				},
				{
					field : 'orderid', 
					title : '账号记录id' 
				},
				{
					field : 'accountId', 
					title : '账号id' 
				},
			    {
					field : 'vipType', 
					title : '充值会员类型',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(datass1, value);
                    }
				},
				/*{
					field : 'vipTypeName', 
					title : '会员类型' 
				},*/
				{
					field : 'price', 
					title : '价格（单位:分）'
				},
				{
					field : 'payMethod', 
					title : '支付方式'
				},
				{
					field : 'status', 
					title : '订单状态',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(datass, value);
                    }
				},
				{
					field : 'createTime', 
					title : '创建时间' 
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>